import JSEncrypt from 'jsencrypt/bin/jsencrypt'

const publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/NFvTvp3bYPStC3AgfROP1AF+Mss' +
  '/Z/s/WtV9dZOjj5UL2kpCl2XyWUvFW0M2XrpFrn1vBMZkMYgade9B39e/Vf7IYIblkm83fN2K1jNUUj9SY' +
  'VQ/Sv2tQR/IrxFvRj3+Mq4Qwf9sZTedvK9JaauP5c7sVbH5TODyV4ak57FSNQIDAQAB'

export function encrypt (data) {
  let encrypt = new JSEncrypt()
  encrypt.setPublicKey(publicKey)
  return encrypt.encrypt(data)
}
